<template>
	<view class="A1">
		<text style="font-size: 60rpx;color: gray;">组件A</text>
		<view class="A2">
			<text>传入值:</text>
			<text>{{intent}}</text>
		</view>
		<button type="primary" @click="sendData()" style="width: 500rpx; height: 100rpx;">给组件B传值</button>
	</view>
</template>

<script>
	export default {
		name: "SonA",
		props: ['intent'],
		data() {
			return {

			};
		},
		methods: {
			sendData() {
				console.warn("--SonA--" + this.intent);
				uni.$emit('getIntent', this.intent);
			}
		}
	}
</script>

<style>
	.A1 {
		background-color: cornsilk;
	}

	.A2 {}
</style>